﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="${BASE_PATH}/static/css/index.css"/>
<link rel="stylesheet" href="${BASE_PATH}/static/css/regist.css" />
<script type="text/javascript" src="${BASE_PATH}/static/js/jquery.js"></script>
<script type="text/javascript" src="${BASE_PATH}/static/js/jquery.form.js"></script>	
<title>用户登陆</title>
<script type="text/javascript" >
	function AjaxSubmit()
    {  
		var cValue =$("#form1").formSerialize();
        $.ajax({
            type: "POST",
            url: "${BASE_PATH}/ersp_sys/userlogin",
			dataType : "json",
			cache : false,
			data : cValue + "&no-cache=" + Math.round(Math.random() * 10000),
			success : onAfterSubmit
		});
	}

	function onAfterSubmit(ret) {
		//保存成功
		if (ret.Code == 1) {
			window.location.href="${BASE_PATH}/services/myspace";
			return;
		}

		if (ret.Code == 2) {
			alert("用户登录失败！");
			return;
		}

		//验证失败
		if (ret.Code == 3) {
			var vCtrlID = ret.ctrlID;
			var vMessage = ret.message;
			$("#" + vCtrlID).focus();
			alert(vMessage);
			return;
		}
	}
</script>	
</head>
<body>

<!--head start-->
<#include "../common/regtop.ftl"/>
<!--head end-->
<form id="form1" name="form1" >
	<div class="box-2 clear-fix">
	<div class="box-01">
    	<span class="a1"></span>
        <h1>用户登录</h1>
        <span class="line"></span>
        <ol>
        	<li><label>用户名：</label><input " type="text" id="UserID" name="UserID" placeholder="请输入手机号码或邮箱或用户名"/><b>*</b></li>
        	<li><label>密&nbsp;&nbsp;&nbsp;码：</label><input type="password" id="KeyWord" name="KeyWord"  placeholder="请输入密码"/><b>*</b></li>
        	<li><a href="#" class="a3" onclick="AjaxSubmit();">登陆</a></li>
        </ol>
    </div>
</div>
</form>
</body>
</html>
